package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**用户 */
@Data
@ApiModel(value = "用户")
@TableName("t_user")
public class UserBean {
    @ApiModelProperty(hidden = true)
    @TableId(value = "pk_userId",type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "用户名")
    @TableField("u_userName")
    private String userName;
    @ApiModelProperty(value = "密码")
    @TableField("u_password")
    private String password="123";
    @ApiModelProperty(value = "真实姓名")
    @TableField("u_name")
    private String name;

    @TableField(exist = false)
    private List<RoleBean> roleList;

    @TableField(exist = false)
    private List<GradeBean> gradeList;

    public UserBean() {
    }

    public UserBean(String userName, String name) {
        this.userName = userName;
        this.name = name;
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<RoleBean> getRoleList() {
        return roleList;
    }

    public void setRoleList(List<RoleBean> roleList) {
        this.roleList = roleList;
    }

    public List<GradeBean> getGradeList() {
        return gradeList;
    }

    public void setGradeList(List<GradeBean> gradeList) {
        this.gradeList = gradeList;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", name='" + name + '\'' +
                ", roleList=" + roleList +
                ", gradeList=" + gradeList +
                '}';
    }
}
